local shuairong = fk.CreateSkill {
  name = "lingling__shuairong",
}

Fk:loadTranslationTable{
  ["lingling__shuairong"] = "衰荣",
  [":lingling__shuairong"] = "出牌阶段限一次，你可以令所有角色依次将手牌调整至两张或四张。若有角色因此：摸了至少三张牌，其翻面；"..
  "弃置了至少三张牌，你翻面。",

  ["#lingling__shuairong"] = "衰荣：令所有角色将手牌调整至2或4",
}

shuairong:addEffect("active", {
  anim_type = "control",
  prompt = "#lingling__shuairong",
  card_num = 0,
  target_num = 0,
  interaction = UI.ComboBox { choices = {"2", "4"} },
  can_use = function(self, player)
    return player:usedSkillTimes(shuairong.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    room:doIndicate(player, room.alive_players)
    local num = tonumber(self.interaction.data)
    for _, p in ipairs(room:getAlivePlayers()) do
      if not p.dead then
        local n = num - p:getHandcardNum()
        if n > 0 then
          local cards = p:drawCards(n, shuairong.name)
          if #cards > 2 and not p.dead then
            p:turnOver()
          end
        elseif n < 0 then
          n = - n
          local cards = room:askToDiscard(p, {
            min_num = n,
            max_num = n,
            include_equip = false,
            skill_name = shuairong.name,
            cancelable = false,
          })
          if #cards > 2 and not player.dead then
            player:turnOver()
          end
        end
      end
    end
  end,
})

return shuairong
